Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tesseract-training: use_mp_libcxx on 10.13 and older #27284

Merged

Conversation

erikbs
Copy link
Contributor

@erikbs erikbs commented Jan 3, 2025

Description

tesseract-training uses std::filesystem from C++17. Xcode 11, which only runs on 10.14 and up, adds support for that. The newest version that needs to link MacPorts libc++ is therefore Darwin 17.

Type(s)
  • bugfix
  • enhancement
  • security fix
Tested on

macOS 10.9.5 13F1911 x86_64
Xcode 6.2 6C131e

Verification

Have you

  • followed our Commit Message Guidelines?
  • squashed and minimized your commits?
  • checked that there aren't other open pull requests for the same change?
  • checked your Portfile with port lint?
  • tried existing tests with sudo port test?
  • tried a full install with sudo port -vst install?
  • tested basic functionality of all binary files?

port lint reports one warning, but it is not new and not related to my changes.

Binary files: tested running /opt/local/bin/text2image --help and verified using otool -L that it is linked against /opt/local/lib/libcxx/libc++.1.0.dylib.

@macportsbot
Copy link

Notifying maintainers:
@markemer for port tesseract.

@macportsbot macportsbot added type: bugfix maintainer: open Affects an openmaintainer port labels Jan 3, 2025
@erikbs
Copy link
Contributor Author

erikbs commented Jan 4, 2025

CI fails on macos-15, but I am pretty sure it is an issue unrelated to the changes in this PR:

2025-01-03T21:13:17.1523590Z Building dependency (10 of 33) 'glib2' with variants '+x11' ... [FAIL]

Copy link
Contributor

@barracuda156 barracuda156 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This needs a revbump, since a new dependency is added.

@erikbs erikbs force-pushed the bugfix/unbreak-tesseract-before-10.14 branch from 592a695 to 45b57af Compare January 7, 2025 19:26
@erikbs erikbs requested a review from barracuda156 January 7, 2025 19:27
@reneeotten
Copy link
Contributor

if this indeed needs std::filesystem and the C++17 as you claim in the description, why don't you request a compiler that is compatible with that? I don't see the need for using mp_libcxx or legacysupport because of this.

@barracuda156
Copy link
Contributor

@reneeotten If the port uses filesystem, then requiring C++17 compiler won’t suffice for systems using libc++, because the system runtime does not support filesystem (until some later macOS version).

@erikbs
Copy link
Contributor Author

erikbs commented Jan 11, 2025

if this indeed needs std::filesystem and the C++17 as you claim in the description, why don't you request a compiler that is compatible with that? I don't see the need for using mp_libcxx or legacysupport because of this.

There already exists a compiler.cxx_standard 2017 directive in the Portfile, so the old compilers that do not support C++17 are blacklisted. On my system it uses MacPorts Clang 16, I think. It has the headers, but by default it links against the version of libc++ that is bundled with the system, which in Mac OS X 10.7 through 10.13 lacks filesystem support (10.6 should work since it does not bundle libc++). Clang/libc++ implements most of std::filesystem as header-only, but __compare and __extension are both defined in path.cpp, so we get linker errors on these OS versions:

Undefined symbols for architecture x86_64:
  "std::__1::__fs::filesystem::path::__extension() const", referenced from:
      __ZNKSt3__14__fs10filesystem4path9extensionB7v160006Ev in unicharset_extractor-unicharset_extractor.o
  "std::__1::__fs::filesystem::path::__compare(std::__1::basic_string_view<char, std::__1::char_traits<char> >) const", referenced from:
      __ZNSt3__14__fs10filesystemeqB7v160006ERKNS1_4pathES4_ in unicharset_extractor-unicharset_extractor.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

@reneeotten reneeotten merged commit 28dd20a into macports:master Jan 11, 2025
3 checks passed
@erikbs erikbs deleted the bugfix/unbreak-tesseract-before-10.14 branch January 11, 2025 14:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
maintainer: open Affects an openmaintainer port type: bugfix
Development

Successfully merging this pull request may close these issues.

5 participants